package com.xoa.dao.WFE;

import com.xoa.model.workflow.FlowRun;
import com.xoa.model.workflow.FlowRunModelPrcs;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface WFEFlowRunMapper {
    //查
    FlowRun find(Map<String, Object> map);

    FlowRun findAnnex(Map<String, Object> map);


    //增
    int insert(FlowRun record);
    //获取最大maxId
    String getMaxRunId();

    //删
    int delete(Map<String,Object> map);
    //更新
    int update(FlowRun record);

    int updateFu(FlowRun record);

    int updateViewUser(String runId);

    List<FlowRunModelPrcs> queryFlowRun(Map<String,Object> map);

    List<FlowRunModelPrcs> queryFlowRunBycy(Map<String,Object> map);
    //更新结束时间或者工作等级或者删除
    int updateState(Map<String,Object> map);


    int updateAttachment(Map<String,Object> map);

    int batchUpdateState(Map<String,Object>map);
    /**
     * 创建作者:   zlf
     * 方法介绍:   删除流程实例信息
     * 参数说明:
     * @return
     */
    public void deleteByRunId(Integer runId);

    int upRunByFouAndTime(FlowRun flowRun);

    List<FlowRunModelPrcs> queryFlowRunBylimit(Map<String,Object> map);

    Integer queryFlowRunCount(Map<String,Object> map);

    List<Integer> queryFlowRunAll(Map<String,Object> map);

    List<Integer> queryFlowRunByPriv(Map<String,Object> map);

    List<Integer> querFlowId(Map<String,Object> map);

    List<Integer> queryRunId(Map<String,Object> map);

    List<Integer> queryRunIdByFlowId(Map<String,Object> map);

    List<FlowRunModelPrcs> toSeniorQuery(Map<String,Object> map);


    List<FlowRunModelPrcs> queryFlowRunZhongList(Map<String, Object> map);

    List<FlowRun> selectZhongId(String flowId);
	
	FlowRun selectBuRunId(Integer runId);

	List<FlowRun> getRecentWorkFlow(Map<String,Object> map);

    //查找出当前办理人的前十条数据(接口获取时间较长，将表拆开来写) 关联flow_run_prcs
    List<FlowRun> findFLowRunPrcs(Map<String, Object> map);

    //查找出当前办理人的前十条数据(接口获取时间较长，将表拆开来写) 关联flow_run_read
    List<FlowRun> findFLowRunRead(Map<String, Object> map);

    int updateRelationRunIds(Map<String, Object> map);

    //根据flowId查找流程
    List<FlowRunModelPrcs> findFlowIdRun(Map map);

    FlowRun findrun(Map<String, Object> map);

    int updatePreSetUser(@Param("runId")Integer runId,@Param("preSetUser")String preSetUser);
}
